﻿//Write a boolean expression for finding if the bit 3 (counting from 0) of a given integer is 1 or 0.

using System;

class IfBit3Is1Or0
{
    static void Main()
    {
        Console.Write("Enter number to check: ");
        int number = int.Parse(Console.ReadLine());
        int position = 3;
        int mask = 1 << position;
        int numberAndMask = number & mask;
        int bit = numberAndMask >> position;
        Console.WriteLine("Bit 3 from the number {0} is {1}", number, bit);
    }
}
